{% if pages > 1 %}
<div class="pagination pagination-centered">
  <ul>
  <li{% if previous %}><a href="{{ get_page_url(previous) }}">&laquo;</a>{% else %} class="disabled"><span>&laquo;</span></li>{% end %}  
  {% for page_num in xrange(1, pages + 1) %}{# 1-index range #}
  <li{% if page_num != page %}><a href="{{ get_page_url(page_num) }}">{{ page_num }}</a>{% else %} class="active"><span>{{ page_num }}</span></li>{% end %}
  {% end %}
  <li{% if next %}><a href="{{ get_page_url(next) }}">&raquo;</a>{% else %} class="disabled"><span>&raquo;</span></li>{% end %}  
</ul>
</div>
{% end %}